package com.wlcorp.forcazamis.domain.pi;

import java.util.Date;

import com.wlcorp.forcazamis.domain.baseinfo.Customer;
import com.wlcorp.forcazamis.domain.baseinfo.SampleSource;
import com.wlcorp.forcazamis.domain.confirm.Confirm;
import com.wlcorp.forcazamis.domain.system.Department;
import com.wlcorp.forcazamis.domain.system.Staff;
import com.wlcorp.forcazamis.sys.BaseBean;
import com.wlcorp.forcazamis.sys.util.AppConstant;
import com.wlcorp.forcazamis.sys.util.CommonUtil;

public class Pidetail extends BaseBean {
	private static final long serialVersionUID = -7235123668728974632L;
	private Long piid;
	private String piCode;// 销售合同编号
	private String customerOgCode;// 客户定单号
	// private Long customerId;// 客户
	private Customer customer;
	private String outDate;// 出运日
	private java.sql.Date piDate;// 下单日期
	private String priceItem;// 价格条款
	private String financialCode;// 财务号
	private Integer priceItemType;// 价格条款选项
	private Long newPiSource;// 新单来源
	private SampleSource source;// 新单来源
	private Integer orderDis;// 排列显示
	private Integer transportType;// 运输方式选项
	private String transportTypeText;// 运输方式
	private String distination;// 目的地
	private String memo;// 备注
	private Integer coinType;// 合同币种
	private Double curExRate;// 当前汇率
	private Double totalSum=0.00;// 总金额
	private Long totalQuantity;// 总数量
	private Double rePiSum=0.00;// 翻单金额
	private Long rePiQuantity;// 翻单数量
	private Double newPiSum=0.00;// 新单金额
	private Long newPiQuantity;// 新单数量
	private Double otherSum=0.00;// 其他费用
	private Double totalDiscount;// 总体折扣
	private String sumDesc;// 费用说明
	private java.sql.Date balanceDate;// 结算日
	private String balanceType;// 结算方式
	private String attachPath;// 附件路径
	private Long createdBy;
	private Staff creator;
	private Date createdDate;
	private Long modifiedBy;
	private Staff modifier;
	private Date modifiedDate;
	private Long confirmId;
	private Confirm confirm;
	private Integer state;
	private Long departmentId;
	private Department department;
	private boolean deleteFlag;
	private String card;// 帐户类型
	private Long customerId;

	public Long getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Long customerId) {
		this.customerId = customerId;
	}

	public boolean isDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(boolean deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public String getAttachPath() {
		return attachPath;
	}

	public void setAttachPath(String attachPath) {
		this.attachPath = attachPath;
	}

	public java.sql.Date getBalanceDate() {
		return balanceDate;
	}

	public void setBalanceDate(java.sql.Date balanceDate) {
		this.balanceDate = balanceDate;
	}

	public String getBalanceType() {
		return balanceType;
	}

	public void setBalanceType(String balanceType) {
		this.balanceType = balanceType;
	}

	public Integer getCoinType() {
		return coinType;
	}

	public void setCoinType(Integer coinType) {
		this.coinType = coinType;
	}

	public Confirm getConfirm() {
		return confirm;
	}

	public void setConfirm(Confirm confirm) {
		this.confirm = confirm;
	}

	public Long getConfirmId() {
		return confirmId;
	}

	public void setConfirmId(Long confirmId) {
		this.confirmId = confirmId;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Staff getCreator() {
		return creator;
	}

	public void setCreator(Staff creator) {
		this.creator = creator;
	}

	public Double getCurExRate() {
		return curExRate;
	}

	public void setCurExRate(Double curExRate) {
		this.curExRate = curExRate;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	// public Long getCustomerId() {
	// return customerId;
	// }
	//
	// public void setCustomerId(Long customerId) {
	// this.customerId = customerId;
	// }

	public String getCustomerOgCode() {
		return customerOgCode;
	}

	public void setCustomerOgCode(String customerOgCode) {
		this.customerOgCode = customerOgCode;
	}

	public String getDistination() {
		return distination;
	}

	public void setDistination(String distination) {
		this.distination = distination;
	}

	public String getFinancialCode() {
		return financialCode;
	}

	public void setFinancialCode(String financialCode) {
		this.financialCode = financialCode;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Long getModifiedBy() {
		return modifiedBy;
	}

	public void setModifiedBy(Long modifiedBy) {
		this.modifiedBy = modifiedBy;
	}

	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	public Staff getModifier() {
		return modifier;
	}

	public void setModifier(Staff modifier) {
		this.modifier = modifier;
	}

	public Long getNewPiQuantity() {
		return newPiQuantity;
	}

	public void setNewPiQuantity(Long newPiQuantity) {
		this.newPiQuantity = newPiQuantity;
	}

	public Long getNewPiSource() {
		return newPiSource;
	}

	public void setNewPiSource(Long newPiSource) {
		this.newPiSource = newPiSource;
	}

	public Double getNewPiSum() {
		return Double.valueOf(CommonUtil.format2Scale(newPiSum));
	}

	public void setNewPiSum(Double newPiSum) {
		this.newPiSum = newPiSum;
	}

	public Integer getOrderDis() {
		return orderDis;
	}

	public void setOrderDis(Integer orderDis) {
		this.orderDis = orderDis;
	}

	public Double getOtherSum() {
		return Double.valueOf(CommonUtil.format2Scale(otherSum));
	}

	public void setOtherSum(Double otherSum) {
		this.otherSum = otherSum;
	}

	public String getOutDate() {
		return outDate;
	}

	public void setOutDate(String outDate) {
		this.outDate = outDate;
	}

	public java.sql.Date getPiDate() {
		return piDate;
	}

	public void setPiDate(java.sql.Date piDate) {
		this.piDate = piDate;
	}

	public Long getPiid() {
		return piid;
	}

	public void setPiid(Long piId) {
		this.piid = piId;
	}

	public String getPriceItem() {
		return priceItem;
	}

	public void setPriceItem(String priceItem) {
		this.priceItem = priceItem;
	}

	public Integer getPriceItemType() {
		return priceItemType;
	}

	public void setPriceItemType(Integer priceItemType) {
		this.priceItemType = priceItemType;
	}

	public Long getRePiQuantity() {
		return rePiQuantity;
	}

	public void setRePiQuantity(Long rePiQuantity) {
		this.rePiQuantity = rePiQuantity;
	}

	public Double getRePiSum() {
		return Double.valueOf(CommonUtil.format2Scale(rePiSum));
	}

	public void setRePiSum(Double rePiSum) {
		this.rePiSum = rePiSum;
	}

	public String getSumDesc() {
		return sumDesc;
	}

	public void setSumDesc(String sumDesc) {
		this.sumDesc = sumDesc;
	}

	public Double getTotalDiscount() {
		return totalDiscount;
	}

	public void setTotalDiscount(Double totalDiscount) {
		this.totalDiscount = totalDiscount;
	}

	public Long getTotalQuantity() {
		return totalQuantity;
	}

	public void setTotalQuantity(Long totalQuantity) {
		this.totalQuantity = totalQuantity;
	}

	public Double getTotalSum() {
		return Double.valueOf(CommonUtil.format2Scale(totalSum));
	}

	public void setTotalSum(Double totalSum) {
		this.totalSum = totalSum;
	}

	public Integer getTransportType() {
		return transportType;
	}

	public void setTransportType(Integer transportType) {
		this.transportType = transportType;
	}

	public String getTransportTypeText() {
		return transportTypeText;
	}

	public void setTransportTypeText(String transportTypeText) {
		this.transportTypeText = transportTypeText;
	}

	public String getPiCode() {
		return piCode;
	}

	public void setPiCode(String piCode) {
		this.piCode = piCode;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public SampleSource getSource() {
		return source;
	}

	public void setSource(SampleSource source) {
		this.source = source;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public Long getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(Long departmentId) {
		this.departmentId = departmentId;
	}

	public String getStateName() {
		String stateName = "";
		if (AppConstant.BILL_STATE_SUBMITED == state) {
			stateName = "编辑中";
		} else if (AppConstant.BILL_STATE_PRE_CONFIRM == state) {
			stateName = "审批中";
		} else if (AppConstant.BILL_STATE_CONFIRMED == state) {
			stateName = "审批完成";
		} else if (AppConstant.BILL_STATE_DRAWBACK == state) {
			stateName = "已退单";
		}
		return stateName;
	}

	public String getCoinTypeName() {
		String coinTypeName = "";
		if (AppConstant.COIN_TYPE_USD == this.getCoinType()) {
			coinTypeName = "USD";
		}
		if (AppConstant.COIN_TYPE_RMB == this.getCoinType()) {
			coinTypeName = "RMB";
		}
		if (AppConstant.COIN_TYPE_EUR == this.getCoinType()) {
			coinTypeName = "EUR";
		}
		return coinTypeName;
	}

	public String getCard() {
		return card;
	}

	public void setCard(String card) {
		this.card = card;
	}

}
